﻿#define  _CRT_SECURE_NO_WARNINGS 1
#include"unorderedMap.h"
#include"unorderedSet.h"
#include<iostream>
using namespace my;
using namespace std;
void test_unordered_map()
{
	unordered_map<string, string> dict;
	dict.insert({ "string", "字符串"});
	dict.insert({ "left", "" });

	dict["sort"];

	dict["left"] = "11";
	dict["right"] = "22";

	unordered_map<string, string>::iterator it = dict.begin();
	while (it != dict.end())
	{
		//it->first += 'x';
		//it->second += 'x';

		cout << it->first << ":" << it->second << endl;
		++it;
	}
	cout << endl;
}
void print(const unordered_set<int>& s)
{
	unordered_set<int>::const_iterator it = s.begin();
	while (it != s.end())
	{
		//*it = 1;
		cout << *it << " ";
		++it;
	}
	cout << endl;
}
void test_unordered_set()
{
	unordered_set<int> us;
	us.insert(5);
	us.insert(1);
	us.insert(3);
	us.insert(5);
	us.insert(315);
	us.insert(5312);
	us.insert(333);

	for (auto e : us)
	{
		cout << e << " ";
	}
	cout << endl;

	unordered_set<int>::iterator it = us.begin();
	while (it != us.end())
	{
		 //*it = 1;
		cout << *it << " ";
		++it;
	}
	cout << endl;

	print(us);
}
class a
{

};
int main()
{
	
	test_unordered_set();
	test_unordered_map();
	return 0;
}